import request from '@/utils/request'
import qs from 'querystring'

const addToken = (data) => {
  data.token = localStorage.getItem('g6Token')
}
const ENV = 'dev'
export default {
  // pt登陆
  ptLogin(data) {
    return request({
      url: `/${ENV}/api/v10/login`,
      method: 'post',
      data
    })
  },
  insertChipModel(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/insertChipModel`,
      method: 'post',
      data
    })
  },
  insertTbox(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/insertTbox`,
      method: 'post',
      data
    })
  },
  insertVehicleEngine(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/insertVehicleEngine`,
      method: 'post',
      data
    })
  },
  insertVehicleType(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/insertVehicleType`,
      method: 'post',
      data
    })
  },
  getChipPrefix(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/getChipPrefix`,
      method: 'post',
      data
    })
  },
  insertTboxModelAuthority(data) {
    addToken(data)
    return request({
      url: `/${ENV}/api/v10/insertTboxModelAuthority`,
      method: 'post',
      data
    })
  }
}
